package day_2022_12_to_3.year2023;

import java.util.HashSet;
import java.util.Set;

/**
 * @author haomin
 * @date 2023/02/20 23:00
 **/
public class Day2_20_Num2347 {
    class Solution {
        public String bestHand(int[] ranks, char[] suits) {
            Set<Character> suitSet = new HashSet<>();
            for(Character c : suits) suitSet.add(c);
            if(suitSet.size() == 1) return "Flush";

            int[] arr = new int[14];
            int max = 0;
            for(int i : ranks) {
                arr[i]++;
                max = Math.max(arr[i], max);
            }
            if(max >= 3) return "Three of a Kind";
            return max == 2 ? "Pair" : "High Card";
        }
    }
}